//
//  BrokerageView.m
//  Cat
//
//  Created by lushitong on 2018/12/18.
//  Copyright © 2018年 lushitong. All rights reserved.
//

#import "BrokerageView.h"

@interface BrokerageView()

@property (nonatomic, strong) UILabel *infoLabel;

@end

@implementation BrokerageView

- (void)setCommissionNumber:(NSNumber *)commissionNumber {
	_commissionNumber = commissionNumber;
	self.infoLabel.text = [NSString stringWithFormat:@"预估佣金￥%.2f",commissionNumber.floatValue];
}

+ (CGSize)getSizeWidthPrizeAmount:(NSNumber *)prizeNumber {
	NSString *calString = [NSString stringWithFormat:@"预估佣金￥%.2f",prizeNumber.floatValue];
	return CGSizeMake([calString getWidthWithFont:[UIFont systemFontOfSize:kQKFitFont(10.0)] height:kQKFitModuleDecimal(10.0)] + kQKFitModuleDecimal(10) + kQKFitModuleDecimal(2.0), kQKFitModuleDecimal(20.0));
}

- (instancetype)initWithFrame:(CGRect)frame {
	self = [super initWithFrame:frame];
	if (self) {
		[self addAllSubViews];
	}
	return self;
}

- (void)addAllSubViews {
	self.backgroundColor = [UIColor clearColor];
	[self addSubview:self.infoLabel];
	[self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self);
	}];
}

#pragma mark----- lazy init -----

- (UILabel *)infoLabel {
	if (!_infoLabel) {
		_infoLabel = [UILabel labelWithFont:[UIFont systemFontOfSize:kQKFitFont(10)] textColor:COLOR_WITH_HEX(0xF6B319)];
		_infoLabel.textAlignment = NSTextAlignmentCenter;
	}
	return _infoLabel;
}

@end
